﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Loyalty.Core.Entities
{
    public class Skill
    {
        public virtual int Id { get; set; }

        public virtual string Title { get; set; }

        public ICollection<Profile> Profiles { get; set; }

    }
}

namespace Loyalty.Core.Entities.Mapping
{
    public class SkillMap : EntityTypeConfiguration<Skill>
    {
        public SkillMap()
        {
            this.HasMany(x => x.Profiles)
                .WithMany(x => x.Skills)
                .Map(map =>
                {
                    map.MapLeftKey("LinkSkillId");
                    map.MapRightKey("LinkProfileId");
                    map.ToTable("ProfileSkills");
                });
        }

    }
}